//
//  SEDetailDiseaseDTO.m
//  kuaiyi
//
//  Created by Alphts on 16/7/7.
//  Copyright © 2016年 Alphts. All rights reserved.
//

#import "SEDetailDiseaseDTO.h"

@implementation SEDetailDiseaseDTO




+ (instancetype)modelWithDictionary:(NSDictionary *)dict{
    
    SEDetailDiseaseDTO *model = [[SEDetailDiseaseDTO alloc] init];
    
    [model setValuesForKeysWithDictionary:dict];
    
    return model;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{}


+ (void)modelArrayWithSuccessBlock:(void(^)(NSArray <SEDetailDiseaseDTO *>* models))successBlock errorBlock:(void(^)())errorBlock{
    
    NSString *urlString = kSearchCI3Url;
    NSDictionary *paramDic = @{
                               @"page_size":@15,
                               @"page":@1,
                               @"ci1_id":@1,
                               @"keyword":@""
                               };
    
    [[NetworkTool shareManager] POST:urlString parameters:paramDic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary *  _Nullable responseObject) {
        
        NSArray *tempArray = responseObject[@"data"];
        
        NSMutableArray *mArray = [NSMutableArray array];
        
        [tempArray enumerateObjectsUsingBlock:^(NSDictionary *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
           
            SEDetailDiseaseDTO *model = [SEDetailDiseaseDTO modelWithDictionary:obj];
            
            [mArray addObject:model];
            
        }];
        
        if (successBlock) {
            successBlock(mArray.copy);
        }
        
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
        NSLog(@"%@--->%@",[self class],error);
        
        if (errorBlock) {
            errorBlock();
        }
        
    }];
    
}




@end






